<?php

namespace common\models\marketing;

use Yii;

/**
 * This is the model class for table "{{%marketing_callback_status}}".
 *
 * @property int $id
 * @property string $callback_name 名称
 * @property int $project_id 所属项目
 * @property int $status 状态【-1删除、0禁用、1启用】
 * @property int $is_inhibit_delete 是否允许删除（0：正常  1：禁止删除）
 * @property int $operation_id 操作人ID【member_id】
 * @property int $created_at 添加时间
 * @property int $updated_at 更新时间
 * @property int $sort 排序（升级）
 */
class CallbackStatus extends \common\models\BaseModel
{
    const ID_NORMAL = 301;// 正常回访

    const STATUS_DELETE = -1;// 删除
    const STATUS_INVALID = 0;// 失效
    const STATUS_ENABLE = 1;// 正常

    const INHIBIT_DELETE = 0;// 正常
    const NOT_INHIBIT_DELETE = 1;// 禁止删除



    //灯塔对应id
    const DT_STATUS = [
        '23' => 300, // 未接通
        '10' => 301, // 正常回访
        '11' => 302, // 拉黑
        '13' => 303, // 已到院
        '29' => 304, // 有意向,
        '32'   => 301, // 有效归属于正常回访 (峰哥说的)
    ];

    const STATUS_NAME = [
        300 => '未接通',
        301 => '正常回访',
        302 => '拉黑',
        303 => '已到院',
        304 => '有意向'
    ];

    // 作废
    const STATUS_ID = [
        1 => [
            'normal' => 3
        ], 3 => [
            'normal' => 6
        ], 4 => [
            'normal' => 10
        ], 5 => [
            'normal' => 35
        ], 6 => [
            'normal' => 27
        ], 7 => [
            'normal' => 15
        ], 8 => [
            'normal' => 19
        ], 9 => [
            'normal' => 23
        ], 10 => [
            'normal' => 39
        ], 11 => [
            'normal' => 43
        ], 12 => [
            'normal' => 32
        ], 13 => [
            'normal' => 48
        ],
    ];


    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return '{{%marketing_callback_status}}';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['project_id', 'status', 'is_inhibit_delete', 'operation_id', 'created_at', 'updated_at', 'sort'], 'integer'],
            [['callback_name'], 'string', 'max' => 60],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'callback_name' => '名称',
            'project_id' => '所属项目',
            'status' => '状态【-1删除、0禁用、1启用】',
            'is_inhibit_delete' => '是否允许删除（0：正常  1：禁止删除）',
            'operation_id' => '操作人ID【member_id】',
            'created_at' => '添加时间',
            'updated_at' => '更新时间',
            'sort' => '排序（升级）',
        ];
    }
}
